<div class="HomeSlogan">Experience the power of expression</div>
<div id="errorMsg"><?php echo $ctx->message;?></div>
<form id="loginform" class="form" name="loginform" method="POST" action="/home/index/register-save">
<div class="Homelogin">
<input type="text" value="Firstname" name="firstname" id="firstname" onfocus="clearField(this.id,'Firstname');" onblur="addValuetoField(this.id,'Firstname');" title="${php: this.translate('valid_email')}" />
<input type="text" value="Email" name="email" id="email" onfocus="clearField(this.id,'Email');" onblur="addValuetoField(this.id,'Email');" />
<input type="password" value="Password" name="password"  id="password" onfocus="clearField(this.id,'Password');" onblur="addValuetoField(this.id,'Password');" />
<input type="password" value="Confirm Password" name="cnfpass" id="cnfpass" onfocus="clearField(this.id,'Confirm Password');" onblur="addValuetoField(this.id,'Confirm Password');" />
<div id="registerButton">
<a class="Button" href="javascript:void(0);" onclick="validate_register();"><span>Register</span></a>
</div>
<div class="clear"></div>
</div>
</form>
  <script type="text/javascript">
function clearField(id,itemvalue)
{
	if($("#"+id).val()==itemvalue){
		$("#"+id).val('');
	}
}
function addValuetoField(id,itemvalue)
{
	if($("#"+id).val()==''){
		$("#"+id).val(itemvalue);
	}
}
  function validate_register()
{
	if($('#firstname').val()=='' || $('#firstname').val()=='Firstname')
	{
		alert("${php: this.translate('errmsg_first_name')}");
		return false;
	}
	if($('#email').val()=='' || $('#email').val()=='Email')
	{
		alert("${php: this.translate('errmsg_email')}");
		return false;
	}
	if($('#email').val()!='')
	{
			if(!isValidEmailAddress($('#email').val()))
				{
				alert("${php: this.translate('errmsg_valid_email')}");
					return false;
				} 
			

	}

	if($('#password').val()=='' || $('#password').val()=='Password')
	{
		alert("${php: this.translate('errmsg_password')}");
		return false;
	}
	if($('#cnfpass').val()==''|| $('#cnfpass').val()=='Confirm Password')
	{
		alert("${php: this.translate('errmsg_confirm_password')}");
		return false;
	}
	if($('#cnfpass').val()!=$('#password').val())
	{
		alert("${php: this.translate('errmsg_password_match')}");
		return false;
	}
	
	
	$('#loginform').submit();
	//return result;
}

  </script>